using System;
using System.Data;
using System.Collections.Generic;
using System.Data.SqlClient;

namespace DataAccess
{
    public class tbAttachment : Popular
    {

        public int id { get; set; }
        
        public string FileName { get; set; }
        public string Link { get; set; }
        public int PostID { get; set; }
        Common<tbAttachment> cm = new Common<tbAttachment>();
        public bool Insert(Popular b)
        {
            return cm.Insert(b as tbAttachment, "sp_tbAttachment_Insert");
        }
        public bool Update(Popular b)
        {
            return cm.UpDate(b as tbAttachment, "sp_tbAttachment_Update");
        }
        public bool Delete(object b)
        {
            return cm.Delete(b, "sp_tbAttachment_Delete");
        }
        public IDataReader Select_ID(object b)
        {
            return cm.Select_ID(b, "sp_tbAttachment_SelectByID");
        }
        public IDataReader Select_Name(object b)
        {
            return cm.Select_Name(b, "sp_tbAttachment_SelectByName");
        }
        public IDataReader SelectAll()
        {
            return cm.Select_All("sp_tbAttachment_SelectAll");
        }
        public List<tbAttachment> SelectAllToList()
        {
            return cm.SelectAll<tbAttachment>("sp_tbAttachment_SelectAll");
        }
    }
}